pp108 : showDialog() Method

showDialog() Method


This method displays a dialog box that contains parameters of the specified application definition.

Syntax

application.showDialog(oApplicationDefinition.XMLDocument.documentElement,[oData],[fpApplicationCallback], [fpCallBackHandler], [bOnCordysRoot]);

Parameters

Parameter

Description

oApplicationDefinition

Required. Denotes the Application Definition of the dialog to be opened.

oData

Optional. Denotes the data to be passed to the dialog window while it loads.

fpApplicationCallback

Optional. Denotes the function to be called after opening the oApplicationDefinition parameter.

fpCallBackHandler

Optional. Denotes the function to be called when the dialog closes with the return value.

bOnCordysRoot

Optional. Boolean that if set to True displays the dialog on the CordysRoot. By default, it is set to False.


Return Value


It does not return a value.

Remarks


The application that is opened as a dialog box should have the dialogReturnValue() method. This method should return data to the calling application.

The dialog boxes that appear are resizable, by default. To disable the resizing of dialog boxes, set the resizable property to off in the features attribute of oApplicationDefinition.

Example

show the dialog box and open the application in it
function showDialog ()
{
    var data = new Object();
    data.property1 = "property1";
    data.property2 = "property2";
    application.showDialog(newApplication.XMLDocument.documentElement, data, null, closeHandler, false);
}
set values to the input controls of the application that is opened in the dialog box 
function Form_InitDone(eventObject) ()
    {
       input1.value =application.event.data.property1;
       input2.value =application.event.data.property2;
    }
function closeHandler(dialogReturnValue)
{
    //The logic to handle the dialogReturnValue goes here.
}
<script type="cordys/xml" id="newApplication">
	    <Application>
	          <url>Application URL </url>
	          <id>Application Id</id>
	          <caption>Application caption</caption>
	          <description>Application description</description>
	          <frame>main</frame>
  	        <data/>	
	   </Application>
</script>


The following is a sample implementation of the dialogReturnValue() function.

function dialogReturnValue()
    {
      	var data = new Object();
       data.oldValue = document.getElementById("input1").value;
       data.newValue = document.getElementById("input2").value;
       return data;
    }